package com.szty.libarytest.persmission

import android.content.Intent
import android.net.Uri
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.provider.Settings
import com.szty.libarytest.R
import com.szty.libarytest.mathtex.MathActivity
import kotlinx.android.synthetic.main.activity_permission.*

class PermissionActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_permission)
        start_permission.setOnClickListener {
            val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            val fromParts = Uri.fromParts("package", packageName, null)
            intent.data = fromParts
            startActivity(intent)
        }
        start_show_math.setOnClickListener {
            startActivity(Intent(this,MathActivity::class.java))
        }
    }
}